Skip to content

Conversation

@positron96
Copy link

This PR adds a simple platform.io file that builds a file for Arduino Uno. Its output exactly matches what Arduino IDE creates.

Having platformio file in this repo allows developers to use "normal" IDEs with autocomplete, refactoring and stuff, while maintaining Arduino compatibility. It also will allow easy autobuilding of release builds with CI/CD pipelines (with pio CLI).

Full compatibility with Arduino IDE is retained (it still works)

@ooxi
Copy link

ooxi commented May 9, 2021

While not opposed to the PR, I don't really see a benefit, since a Makefile is already present? Moreover, those commits should be squashed before creating a PR.

@positron96
Copy link
Author

positron96 commented May 14, 2021

I'll squash the commits in the nearest future.
Anyway, could you elaborate more on Makefiles? It makes no difference for PIO users since PlatformIO uses its own build system (in a way, PIO is a build system)

…y matches what Arduino IDE creates.

added newline at end of file

ignoring platformio folders.
@avion23
Copy link

avion23 commented Jul 9, 2021

This MR would help me tremendously.

I can see that there is already a make-system. But platformio is the one build system to rule them all and supports all kinds of flashers and bootloaders.

@dsiguero
Copy link

dsiguero commented Aug 2, 2021

What's the rationale for not merging this?

@rob-deutsch
Copy link

I would also like to see this merged. PlatformIO is a wonderful build system which makes it much easier to get up and running with GRBL.

@NuwanJ
Copy link

NuwanJ commented Oct 21, 2023

Agree with you @rob-deutsch. Having a Makefile is ok. But platformio.ini is more than a build config file, which allows to compile/build GRBL with VS Code + Platform IO easily.

@mydani
Copy link

mydani commented Jan 28, 2024

One more voting for the merge of this PR - platformio is status-quo for sophisticated development.

@tcurdt
Copy link

tcurdt commented Aug 15, 2025

As an open source maintainer myself tickets like this make me sad...

$ make
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=atmega328p -I. -ffunction-sections -flto -MMD -MP -c grbl/main.c -o build/main.o
make: avr-gcc: No such file or directory
make: *** [build/main.o] Error 1

# of course you need to install the deps first!
# but which?
$ brew search avr-gcc
# hmmmm

$ pio run
Processing uno (platform: atmelavr; board: uno; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/uno.html
PLATFORM: Atmel AVR (3.4.0) > Arduino Uno
HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 31.50KB Flash
DEBUG: Current (avr-stub) On-board (avr-stub, simavr)
PACKAGES:
 - framework-arduino-avr @ 5.1.0
 - toolchain-atmelavr @ 1.70300.191015 (7.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 5 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/uno/src/coolant_control.c.o
Compiling .pio/build/uno/src/eeprom.c.o
Compiling .pio/build/uno/src/gcode.c.o
...
Archiving .pio/build/uno/libFrameworkArduino.a
Indexing .pio/build/uno/libFrameworkArduino.a
Linking .pio/build/uno/firmware.elf
Checking size .pio/build/uno/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [========  ]  79.7% (used 1633 bytes from 2048 bytes)
Flash: [========= ]  92.2% (used 29738 bytes from 32256 bytes)
Building .pio/build/uno/firmware.hex

5 years - FIVE years.

Thanks for the PR @positron96

@rob-deutsch
Copy link

Is GRBL being actively maintained? I suspect not.

@mar0x
Copy link

mar0x commented Aug 17, 2025

@tcurdt, it depends on environment and backgound:

% pio run                                                                                                              
zsh: command not found: pio
% brew search pio
# hmmmm

% arduino-cli -v compile -b arduino:avr:uno --libraries . --build-path .build --warnings all grbl/examples/grblUpload
...
Sketch uses 29738 bytes (92%) of program storage space. Maximum is 32256 bytes.
Global variables use 1633 bytes (79%) of dynamic memory, leaving 415 bytes for local variables. Maximum is 2048 bytes.

Used library Version Path
grbl                 ...../grbl/grbl

Used platform Version Path
arduino:avr   1.8.6   ...../Library/Arduino15/packages/arduino/hardware/avr/1.8.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants